using System;
using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;
using UnityEngine.XR;
using static System.Net.WebRequestMethods;

public class 物品生成 : MonoBehaviour
{
    public TMP_InputField name;
    public TMP_InputField id;
    public TMP_InputField Description;
    public TMP_Text Category;

    public fastbackpack fbp;

    void Start()
    {
        
    }

    public void creatitem()
    {
        ItemCategory ic= (ItemCategory)Enum.Parse(typeof(ItemCategory), Category.text, true);
        Item a = new Item(name.text, ic, id.text, Description.text);
        Debug.Log("物品创建成功");
        物品管理器.SingleItemManage.RegisterItem(a);
        Debug.Log("物品注册成功，cnt为" + a.Itemcnt);
        fbp.additem(a);
    }
}
